﻿<!doctype html>
<html>
<head>
    <title>SpreadJS - Sheet Paint</title>
    <meta charset="utf-8"/>
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1"/>

    <link href="../../../external/spreadjs/css/gcspread.sheets.excel2013white.9.40.20161.0.css" rel="stylesheet" type="text/css" />

    <script src="../../../external/external/jquery-1.8.2.min.js" type="text/javascript"></script>

    <script type="text/javascript" src="../../../external/spreadjs/gcspread.sheets.all.9.40.20161.0.min.js"></script>

    <script id="scriptInit" type="text/javascript">
    /*code_begin*/
        $(document).ready(function () {
            var spread = new GcSpread.Sheets.Spread(document.getElementById("ss"), { sheetCount: 1 });
            var spreadNS = GcSpread.Sheets;

            $("#setValue").click(function () {
                var sheet = spread.getActiveSheet();
                var cellRange = sheet.getSelections()[0];
                if (cellRange) {
                    for (var row = cellRange.row, rowCount = cellRange.row + cellRange.rowCount; row < rowCount; row++) {
                        for (var col = cellRange.col, colCount = cellRange.col + cellRange.colCount; col < colCount; col++) {
                            sheet.setValue(row, col, 'SpreadJS');
                        }
                    }
                }
            });

            function getActualRange(range, maxRowCount, maxColCount) {
                var row = range.row < 0 ? 0 : range.row;
                var col = range.col < 0 ? 0 : range.col;
                var rowCount = range.rowCount < 0 ? maxRowCount : range.rowCount;
                var colCount = range.colCount < 0 ? maxColCount : range.colCount;

                return new spreadNS.Range(row, col, rowCount, colCount);
            }

            $("#isPaintSuspend").click(function () {
                spread.isPaintSuspended($(this).prop("checked"));

                spread.invalidateLayout();
                spread.repaint();
            });
        });
    /*code_end*/
    </script>
</head>
<body>
<div class="sample-turtorial">
    <div id="ss" style="width:100%; height:410px;border: 1px solid gray;"></div>
    <div class="demo-options">
        <div class="option-row">
            <input type="button" id="setValue" value="Set Value 'SpreadJS'" />
            <input type="checkbox" id="isPaintSuspend" />
            <label for="isPaintSuspend">isPaintSuspend</label>
        </div>
    </div>
</div>
</body>
</html>
